home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / pushd < prev    next >
Text File  |  1995-03-31  |  2KB  |  58 lines

  1. Article 2441 of comp.sys.handhelds:
  2. Path: en.ecn.purdue.edu!noose.ecn.purdue.edu!mentor.cc.purdue.edu!purdue!bu.edu!rpi!zaphod.mps.ohio-state.edu!van-bc!ubc-cs!fs1!fs1.ee.ubc.ca!jthornto
  3. From: jthornto@fs1.ee.ubc.ca (THORNTON JOHAN A)
  4. Newsgroups: comp.sys.handhelds
  5. Subject: PUSHD and POPD
  6. Summary: utilities
  7. Keywords: directory push/pop
  8. Message-ID: <1447@fs1.ee.ubc.ca>
  9. Date: 19 Nov 90 12:52:20 GMT
  10. Sender: root@fs1.ee.ubc.ca
  11. Reply-To: jthornto@fs1.ee.ubc.ca (THORNTON JOHAN A)
  12. Followup-To: comp.sys.handhelds
  13. Organization: Dept. of Electrical Engineering University of B.C.
  14. Lines: 40
  15.  
  16. Here are PUSHD and POPD, two utilities that I find often come in handy.  PUSHD
  17. of course saves your current directory in a directory stack, and POPD pulls
  18. off the last place where you were.  The directory paths are stored as lists
  19. in a list called DPATH, which you must create in the root directory.
  20. ( HOME {} 'DPATH' STO )
  21.  
  22. I hope you are using the HOME-MAIN utility management method; put the programs
  23. in the HOME directory.  If you're stingy with memory, kill the error message
  24. from POPD - remove everything between DROP and END.
  25.  
  26.  
  27. @ PUSHD - push current directory
  28. %%HP: T(3)A(D)F(.);
  29. \<< PATH DUP 1 \->LIST
  30. HOME 'DPATH' STO+
  31. EVAL
  32. \>>
  33.  
  34.  
  35. @ POPD - pop directory
  36. %%HP: T(3)A(D)F(.);
  37. \<< HOME DPATH OBJ\-> DUP
  38.   IF
  39.   THEN 1 - \->LIST
  40. 'DPATH' STO EVAL
  41.   ELSE DROP
  42. "POPD Error:" 1
  43. "Directory Stack Empty"
  44. 2 DISP DISP 1
  45. FREEZE
  46.   END
  47. \>>
  48.  
  49.  -------  _/__/   -----------------------------------------------------
  50.         _|  ___|    E l e c t r i c a l      |  Johan Thornton, Esq.
  51.        | | |_/     E n g i n E E r i n g     |-------------------------
  52.        |/|  __|     U n i v e r s i t y      |  jthornto@fs1.ee.ubc.ca
  53.        |-| |/__     o f   B r i t i s h      |-------------------------
  54.        | |_____|      C o l u m b i a        |   This space for rent
  55.  ----  |__|/_|   ------------------------------------------------------
  56.  
  57.  
  58.